package com.example.qt.ptplatform.config;

import io.pinecone.clients.Pinecone;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class PineconeConfig {

    // 使用 @Value 注解从 application.yml 中读取配置
    @Value("${pinecone.api-key}")
    private String apiKey;

    @Bean
    public Pinecone pineconeClient() {
        // 使用从配置文件中读取的 apiKey 来初始化 Pinecone 客户端
        return new Pinecone.Builder(apiKey).build();
    }
}


